<template>
  <div>
    <div class="news" v-for="(item,index) in news_list" :key="index">
        <!-- 上边 -->
        <div class="upBox">
            <div class="wordBox">
                <p class="title">{{ item.title }}</p>
                <p class="date">{{ item.date }}</p>
            </div>
            <div v-if="item.srcUrl != null">
                <img :src="item.srcUrl"/>
            </div>
        </div>
        <!-- 下边 -->
        <div class="downBox" v-if="item.Commentator">
            <div class="line"></div>
            <div class="comment" v-for="(v,i) in item.Commentator" :key="i">
                <span class="author">{{ v.author }}</span>：
                <span class="content">{{ v.content }}</span>
            </div>
        </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'news',
  data(){
    return{
      news_list:[
        {id:1,title:'合肥新桥国际机场二期改扩建工程开工',srcUrl:require('@/assets/images/news/news1.jpg'),date:'发表于3小时前',Commentator:[{id:11,author:'探索中的rookie',content:'完全是浪费钱，现在的航站楼都还可以。'},{id:12,author:'初音',content:'远期规划啊'}]},
        {id:2,title:'波音空客将加快推出777XF和A350F',srcUrl:require('@/assets/images/news/news2.jpg'),date:'发表于4小时前',Commentator:[{id:21,author:'游客',content:'看来拉猪比拉人赚钱了啊'}]},
        {id:3,title:'韩国首迎“航空旅游气泡团”，新加坡游客入境核酸阴性免隔离',srcUrl:null,date:'发表于8小时前'},
        {id:4,title:'加拿大10月入境旅客较去年同期增逾14倍',srcUrl:require('@/assets/images/news/news4.jpg'),date:'发表于8小时前'},
        {id:5,title:'海航货运开通北京一布鲁塞尔“客改货”航班',srcUrl:require('@/assets/images/news/news5.jpg'),date:'发表于8小时前'},
        {id:6,title:'空客下调客机需求预测...',srcUrl:require('@/assets/images/news/news6.jpg'),date:'发表于10小时前',Commentator:[{id:61,author:'Mark',content:'这个下调幅度也叫不乐观？全球需求2021年...'}]},
        {id:7,title:'酷航航点拓展至英国伦敦...',srcUrl:require('@/assets/images/news/news7.jpg'),date:'发表于11小时前'},
        {id:8,title:'香港国际机场10月份航空交通量公布...',srcUrl:require('@/assets/images/news/news8.jpg'),date:'发表于12小时前'},
        {id:9,title:'厦门新机场去的新进展航站区及配套工程初步设计获批',srcUrl:require('@/assets/images/news/news9.jpg'),date:'发表于12小时前'},
        {id:10,title:'辽宁大连开展第三轮全员核酸检测...',srcUrl:require('@/assets/images/news/news10.jpg'),date:'发表于1天前'},
        {id:11,title:'柳州机场开展“无纸化乘机·绿色、便捷码上出发”主题志愿者活动...',srcUrl:require('@/assets/images/news/news11.jpg'),date:'发表于1天前',Commentator:[{id:111,author:'雨霖铃',content:'柳州航班现在是越来越少'}]},
        {id:12,title:'越南六家机场获得AHA国际认证...',srcUrl:require('@/assets/images/news/news12.jpg'),date:'发表于1天前'},
        {id:13,title:'达茂百灵机场顺利通过通用机场许可审定工作',srcUrl:require('@/assets/images/news/news9.jpg'),date:'发表于8小时前'},
    ],
    }
  },
  created(){

  },
  methods:{

  }
} 
</script>

<style scoped>
.news{
  width: 320px;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 10px;
  padding: 0 15px 10px 15px;
  margin-bottom: 10px;
}
.upBox{
    padding: 10px;
    display: flex;
    justify-content: space-between;
}
.upBox .wordBox{
    width: 185px;
    text-align: left;
}
.upBox .date{
    font-size: 12px;
    color: #8f8f8f;
    margin-top: 14px;
}
.upBox img{
    width: 105px;
    height: 70px;
    margin-top: 20px;
    border-radius: 10px;
}
.downBox{
    text-align: left;
}
.downBox .line{
    border-top: 1px solid #e1e1e1;
    padding: 8px 0;
    line-height: 3px;
}
.downBox .author{
    font-size: 14px;
    color: #9a9a9a;
}
.downBox .comment{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.downBox .content{
    font-size: 14px;
    color: #0b0b0b;
}
.news:last-child{
  margin-bottom: 70px;
}

</style>
